package com.wenx;

import java.util.List;

public class OrderMain {

    public static void main(String[] args) {

        //前序遍历
        TreeSorts preTreeSorts = new PreorderTraversal();
        List<Integer> preTraversal = preTreeSorts.treeTraversal();
        System.out.println("前序遍历 = " + preTraversal);
        List<Integer> sorted = preTreeSorts.getSorted();
        System.out.println("sorted = " + sorted);

        //中序遍历
        TreeSorts inTreeSorts = new InOrderTraversal();
        List<Integer> inTraversal = inTreeSorts.treeTraversal();
        System.out.println("中序遍历 = " + inTraversal);

        //后序遍历
        TreeSorts postTreeSorts = new PostOrderTraversal();
        List<Integer> postTraversal = postTreeSorts.treeTraversal();
        System.out.println("后序遍历 = " + postTraversal);

    }

}
